import { defineStore } from "pinia";
import { ref } from "vue";

const useCityStore = defineStore('city', () => {
    const cityName = ref('北京')
    const cityId = ref(110100)
    const change = (name, id) => {
        //ref方式修改值时要 .value
        cityName.value = name
        cityId.value = id
    }
    return {
        cityName, cityId,
        change,
    }
})
export default useCityStore